package dk.mirasola.systemtraining.bridgewidgets.shared.model;

public enum Seat {
    NORTH, EAST, SOUTH, WEST;

    static {
        for (Seat seat : Seat.values()) {
            switch (seat) {
                case NORTH:
                    seat.rho = WEST;
                    seat.lho = EAST;
                    seat.partner = SOUTH;
                    break;
                case EAST:
                    seat.rho = NORTH;
                    seat.lho = SOUTH;
                    seat.partner = WEST;
                    break;
                case SOUTH:
                    seat.rho = EAST;
                    seat.lho = WEST;
                    seat.partner = NORTH;
                    break;
                case WEST:
                    seat.rho = SOUTH;
                    seat.lho = NORTH;
                    seat.partner = EAST;
                    break;
            }
        }
    }

    private Seat rho;
    private Seat lho;
    private Seat partner;

    /**
     * Return the seat of right hand opponent
     *
     * @return seat of right hand opponent
     */
    public Seat getRHO() {
        return rho;
    }

    /**
     * Return the seat of left hand opponent
     *
     * @return seat of left hand opponent
     */
    public Seat getLHO() {
        return lho;
    }

    /**
     * Return the seat of partner
     *
     * @return seat of partner
     */
    public Seat getPartner() {
        return partner;
    }
}
